const express = require('express');
const router = express.Router();
const { 
    getVersionData, 
    updateCell, 
    addColumn, 
    saveAsNewVersion, 
    compareVersions, 
    exportExcel 
} = require('../controllers/versionController');

// 获取特定版本的数据
router.get('/versions/:versionId/data', getVersionData);

// 更新单元格数据
router.put('/versions/:versionId/cell', updateCell);

// 添加自定义列
router.post('/versions/:versionId/column', addColumn);

// 保存当前版本的修改为新版本
router.post('/versions/:versionId/save-new-version', saveAsNewVersion);

// 版本比较
router.get('/versions/compare/:version1/:version2', compareVersions);

// 导出Excel
router.get('/versions/:versionId/export', exportExcel);

module.exports = router;